package servlet;

import java.io.IOException;
import javax.servlet.RequestDispatcher;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.*;
import connection.DbConnection;
import java.sql.ResultSet;
import java.util.*;
import model.EmailingSystem;
import model.InternalMail;
import model.PollUserImpl;
import bean.Message;
import bean.PollUser;

public class selectVotingPollServlet extends HttpServlet {

	
	/**
	 * 
	 */
	private static final long serialVersionUID = -5363361406964652222L;

	public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		doPost (request, response);
	}
	
	public void doPost (HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		response.setContentType("text/html");
		response.setCharacterEncoding("GBK");
		
		// Error checking
		System.out.println("doPost method of selectVotingPollServlet reached");
		
		// Get parameters
		String selected_poll = request.getParameter("selected_poll");
		
		// Error checking
		System.out.println("selected_poll: "+selected_poll);
		
		request.getSession().setAttribute("selected_poll", selected_poll);
		
		response.sendRedirect("administerVoting.jsp");
	}
}
